<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/20
 * Time: 16:20
 */

$str = 'asdfasdfasdasfdate20170920asdfafdadate20170921sadfasasddate20170922fadate20170923s';

if (preg_match_all('/date(\d{4})(\d{2})(\d{2})/',$str,$m)){
    echo 'yes';
    var_dump($m);
//    var_dump($m[1]);
    $year = $m[1];
    $month = $m[2];
    $day = $m[3];
    var_dump($day);
} else {
    echo "no";
    var_dump($m);
}

